﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Reap.Common.Runtime.Dependency;

namespace Reap.Common.Runtime {
	/// <summary>
	/// 引擎接口
	/// </summary>
	public interface IEngine {

		#region ContainerManager
		IContainerManager ContainerManager { get; }
		#endregion

		#region Resolve

		T Resolve<T>(params Parameter[] parameters) where T : class;
		T Resolve<T>(string name, params Parameter[] parameters) where T : class;
		object Resolve(Type type, params Parameter[] parameters);
		object Resolve(Type type, string name, params Parameter[] parameters);

		#endregion

		#region TryResolve

		T TryResolve<T>(params Parameter[] parameters) where T : class;
		T TryResolve<T>(string name, params Parameter[] parameters) where T : class;
		object TryResolve(Type type, params Parameter[] parameters);
		object TryResolve(Type type, string name, params Parameter[] parameters);

		#endregion

		#region ResolveAll
		IEnumerable<Object> ResolveAll(Type serviceType);
		IEnumerable<T> ResolveAll<T>();
		#endregion
	}
}
